<template>
    <div ref="body">
        <Form :label-width="130" inline>
            <Form-item label="申请人姓名:">
                <Input v-model="queryParam.azcp0003" placeholder="请输入申请人姓名" style="width:180px"/>
            </Form-item>

            <Form-item label="申请人证件号码:">
                <Input v-model="queryParam.azcp0001" placeholder="请输入申请人证件号码" style="width:180px"/>
            </Form-item>
            <Form-item label="保障类型:">
                <c-dict-select v-model="queryParam.ssca0002" dictCode="assistancetype" style="width:180px"
                               showKeys="100,101,102,200,201,202,203,500"/>
            </Form-item>
            <Form-item label="业务类型:">
                <c-dict-select v-model="queryParam.ssca0016" dictCode="handletype" style="width:180px"
                               showKeys="100,200,204,212,213,214,215,216,217,300,500,501,700"/>
            </Form-item>
            <Row class="button_row">
                <span style="float: right;">
                 <Button type="primary" @click="searchQuery">查询</Button>
                 <Button type="primary" class="button_item_left" @click="searchReset">重置</Button>
                </span>
            </Row>
        </Form>

        <div class="table_div">
            <vxe-table border
                       resizable
                       row-id="id"
                       :row-key="true"
                       show-overflow="tooltip"
                       highlight-hover-row
                       align="center"
                       header-align="center"
                       ref="xTree"
                       :loading="Loading"
                       :data="tableData">
                <vxe-table-column field="processname" title="业务流程" align="center" width="165"/>
                <vxe-table-column field="create_date" title="受理时间" align="center" width="160"
                                  :formatter="renderDetailTime"/>
                <vxe-table-column field="finish_date" title="办结时间" align="center" width="160"
                                  :formatter="renderDetailTime"/>
                <vxe-table-column field="taskname" title="办结环节" align="center" width="140"/>
                <vxe-table-column field="exceptionname" title="异常类型" align="center" width="140"/>
                <vxe-table-column field="azcp0003" title="申请人姓名" align="center" width="140"/>
                <vxe-table-column field="azcp0001" title="申请人证件号码" align="center" width="160"/>
                <vxe-table-column field="ssca0002_name" title="保障类型" align="center" width="140"/>
                <vxe-table-column field="ssca0016_name" title="业务类型" align="center" width="110"/>
                <vxe-table-column field="azaa0002" title="属地区划" align="center" width="200"/>
                <vxe-table-column field="" title="操作" min-width="80" fixed="right">
                    <template v-slot="{ row }">
                        <Button type="info" size="small" style="margin-right: 5px" @click="handle(row)"
                                :loading="btnStatus">归档
                        </Button>
                    </template>
                </vxe-table-column>
            </vxe-table>
            <Page :total="dataCount" :page-size="pageSize" show-total class="paging"
                  @on-change="handleTableChange" :current="pageNo"></Page>
        </div>
    </div>
</template>
<script>
    import {CommonMixin} from '@/views/common/js/CommonMixin'
    import {postAction} from '@/api/request'

    export default {
        name: 'filing-monitor-list',
        mixins: [CommonMixin],
        data() {
            return {
                columns: [],
                url: {
                    list: '/api/ac/subsistence/ss00000Service/getFilingExceptionPageList',
                    filing: '/api/ac/subsistence/ss00000Service/saveDoFilingAgain'
                },
                queryParam: {
                    //assistancetype: "100"
                },
                assistancetype: '',
                Loading: false,
                btnStatus: false,
            }
        },
        methods: {
            handle: function (row) {
                let that = this
                that.btnStatus = true
                let url = that.url.filing
                let dataParam = {}
                dataParam.processinstid = row.processinstid
                dataParam.exceptiontype = row.exceptiontype
                dataParam.ssca0002=row.ssca0002
                postAction(url, dataParam).then((res) => {
                    if (res.data.errcode != 0) {
                        that.$Message.error(res.data.errmsg)
                        that.btnStatus = false
                    } else {
                        that.$Message.success(res.data.data.msg)
                        that.btnStatus = false
                        that.loadData()
                    }
                })
            },
        },
        created() {
            this.loadData()
        },
    }
</script>

<style scoped>
    .paging {
        float: right;
        margin-top: 10px;
    }

    /deep/ .ivu-form-item {
        margin-bottom: 10px;
    }

</style>
